/* 
	@Copyright (c) 2007 by Denis Riabtchik. All rights reserved. See license.txt and http://jgrouse.com for details@
	$Id: ModuleElement.java 374 2008-03-08 20:47:55Z denis.riabtchik $
*/

package jgrouse.jgdoc.elements;

import java.util.Arrays;

import jgrouse.jgdoc.api.IModuleElement;

public class ModuleElement extends RefContainer implements IModuleElement
{  

	private static final long serialVersionUID = 4775920489185009482L;

	@Override
	public String getElementType()
	{
		return "module-";
	}
	
	public String getPath()
	{
		return getAttribute("path");
	}
	
	public void setFullName(String fname)
	{
		String[] s = fname.split("\\.");
		String last = s[s.length - 1];
		s[s.length - 1] = "module-" + last;
		String path = DocElement.join(Arrays.asList(s), "/");
		super.setFullName("module-" + fname);
		setLocalName(fname);
		addAttribute("path", path);
	}

}
